<?php
require_once APP . '/application/admincontrollers/AdminAction.php';
/**
 * 平台设置
 * @package admin
 */
class PoolController extends AdminAction
{
    
    public function init()
    {
    }
	
    
    /**
     * 邮箱设置
     *
     */
    public function setAction()
    {
    	$arr_keys = array();
    	$arr_keys['max'] = "大彩池";
    	$arr_keys['min'] = "小彩池";
    	
    	// set
    	$params = $this->getAllParams();
    	
    	$setflag = false;
    	foreach ($params as $key => $v){
    		if (isset($arr_keys[$key])){
    			$setflag = true;
    			$this->db->update("pool", array("value" => $v), "name='" . $key . "'");
    		}
    	}
    	
    	$values = $this->db->fetchAssoc("select * from pool");
    	$arr = array();
    	foreach ($values as $key => $v){
    		$arr[$key] = $v['value'];
    	}
    	
    	$this->view->keys = $arr_keys;
    	$this->view->values = $arr;
    	$this->view->setflag = $setflag;
    }
}